home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MISC / SHELL.ARC / Shell / Sources / c / DVector < prev    next >
Text File  |  1994-06-25  |  1KB  |  69 lines

  1. #include <stdio.h>
  2.  
  3. #include "DeskLib:WimpSWIs.h"
  4.  
  5. #include "Shell.Vector.h"
  6. #include "Shell.Extra.h"
  7. #include "Shell.SafeAlloc.h"
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. #define COLUMN_WIDTH 8
  15.  
  16.  
  17.  
  18.  
  19.  
  20. static void    Shell_DoubleVerticalVectorDrawer(
  21.     Shell_convertpoint    convert,
  22.     wimp_point        rectsize,
  23.     void            *reference,
  24.     const wimp_rect        *redrawrect
  25.     )
  26. {
  27.     wimp_rect        rect    = *redrawrect;
  28.     double            *data    = (double *) reference;
  29.     int            j;
  30.     char            s[64];
  31.  
  32. Shell_ConvertToSubTextRect2( &rect, rectsize);
  33.  
  34. for ( j=rect.min.y; j<=rect.max.y; j++)    {
  35.     sprintf( s, "%.2g", data[j]);
  36.     s[ COLUMN_WIDTH-1] = '\0';
  37.     Shell_PrintString( s, 0, rectsize.y - j*Shell_TEXTYSIZE, convert);
  38.     }
  39.  
  40. return;
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47. Shell_rectblock    *Shell_AddDoubleVerticalVector(
  48.     Shell_windblock *w, int x, int y, int size,
  49.     int forecol, int backcol, double *data
  50.     )
  51. {
  52.     Shell_rectblock        *rectblock;
  53.  
  54. rectblock = Shell_AddRectangle2(
  55.     w,
  56.     x, y - size*Shell_TEXTYSIZE,
  57.     x + COLUMN_WIDTH * Shell_TEXTXSIZE, y,
  58.     Shell_DoubleVerticalVectorDrawer,
  59.     (void *) data
  60.     );
  61.  
  62.  
  63. Shell_MakeRectIcon( rectblock, forecol, backcol, "r1");
  64.  
  65. return rectblock;
  66. }
  67.  
  68.  
  69.